package com.forekonw.demo4;

import java.util.Scanner;

/**
 * 登录
 * slect * from user where yonghu=a and mima=b
 */
public class TestMethodlianxi {
    public static boolean login(String username,String password){
        String c = "tom";
        String d = "123456";
        if (username.equals(c) && password.equals(d)){
            return true;
        }else {
            return false;
        }
    }

    /**
     *注册
     */
    public static boolean register(String a,String b){

        return false;
    }

    /**
     *查询根据id查询某个用户的信息
     */
    public static String inquiry(int a){
        return "张三";
    }





    /**
     *查询所有用户的信息
     * select * from user
     */
    public static String[] getqueryall (){
        String[] str = new String[10];
        str[0] = "tom";
        str[1] = "tony";
        return str;
    }




    /**
     *根据id删除某个用户的信息
     * delete from user where id = ?
     * true 表示成功了
     */

    public static boolean deletebyid(int id){
        return true;
    }





    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String username = input.next();
        String password = input.next();
        boolean isRight = login("tom","123456");
        if (isRight){
            System.out.println("success......");
        }else {
            System.out.println("error......");
        }



        boolean a =deletebyid(1001);
        if (a){
            System.out.println("delect success......");
        }else {
            System.out.println("delect fail......");
        }



        String[] all = getqueryall();
        for (int i =0;i <all.length;i++){
            System.out.println(all[i]);
        }




    }
}
